package o;

import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import java.lang.ref.WeakReference;

public abstract class egf {
    public int ˊ = -1;
    private WeakReference<b> ॱ;

    public interface b {
        void ˊ(int i, int i2);

        void ˋ(int i, int i2);
    }

    protected abstract cvt ˋ(int i);

    protected abstract cvt ˎ();

    protected abstract int ॱ(BaseRequest o_cvu, ResponseBean responseBean, int i);

    public int ॱ() {
        return this.ˊ;
    }

    protected void ˊ(int i) {
        this.ˊ = i;
    }

    public void ˎ(b bVar) {
        this.ॱ = new WeakReference(bVar);
    }

    public void ˊ() {
        ॱ(ˎ(), 0);
    }

    public void ॱ(int i) {
        ॱ(ˋ(i), 1);
    }

    private void ॱ(cvt o_cvt, final int i) {
        cfw.ˎ(o_cvt, new IServerCallBack(this) {
            final /* synthetic */ egf ˏ;

            public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
            }

            public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
                this.ˏ.ˋ(o_cvu, responseBean, i);
            }
        });
    }

    private void ˋ(BaseRequest o_cvu, ResponseBean responseBean, int i) {
        int ॱ = ॱ(o_cvu, responseBean, i);
        int responseCode = responseBean.getResponseCode();
        b bVar = (b) this.ॱ.get();
        if (bVar == null) {
            return;
        }
        if (i == 1) {
            bVar.ˋ(responseCode, ॱ);
        } else if (i == 0) {
            bVar.ˊ(responseCode, ॱ);
        }
    }
}
